package com.zoop.bootfeign.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.zoop.bootfeign.service.BootJpaService;
import com.zoop.bootfeign.service.TestService;

@RestController
@RequestMapping(value = "/test")
public class TestController {

	@Resource
    private TestService gitHubFeign;
	
	@Resource
	private BootJpaService bootJpaService;
	
	@RequestMapping(value = "/search")
    public String searchRepo(@RequestParam("q") String q) {
        return gitHubFeign.searchRepo(q);
    }
	
	@RequestMapping(value = "/jpaTest")
	public Map<String, Object> jpaTest(){
		return bootJpaService.test();
	}
	
}
